+ ${uiLabelMap.WebtoolsEntityDisplayed}: ${numberShowed}
+
+
+
\ No newline at end of file
Index: framework/webtools/webapp/webtools/entity/entityref.jsp
===================================================================
--- framework/webtools/webapp/webtools/entity/entityref.jsp (revision 474917)
+++ framework/webtools/webapp/webtools/entity/entityref.jsp (working copy)
@@ -1,46 +0,0 @@
-<%--
-Copyright 2001-2006 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations
-under the License.
---%>
-
-<%@ page import="org.ofbiz.base.util.*" %>
-
-
-
-
Entity Reference Chart
-
-<%String controlPath=(String)request.getAttribute("_CONTROL_PATH_");%>
-<%
- String list = controlPath + "/view/entityref_list";
- String main = controlPath + "/view/entityref_main";
- String search = (String) request.getParameter("search");
- String forstatic = (String) request.getParameter("forstatic");
- if (search != null) {
- list = list + "?search=" + search;
- main = main + "?search=" + search;
- } else if (forstatic != null) {
- list = list + "?forstatic=" + forstatic;
- main = main + "?forstatic=" + forstatic;
- }
-%>
-
-
-Frame Alert
-This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
-
-
-
Index: framework/webtools/webapp/webtools/entity/CheckDb.ftl
===================================================================
--- framework/webtools/webapp/webtools/entity/CheckDb.ftl (revision 0)
+++ framework/webtools/webapp/webtools/entity/CheckDb.ftl (revision 0)
@@ -0,0 +1,101 @@
+<#--
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License. You may obtain a copy of
+the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
+-->
+
+
${uiLabelMap.WebtoolsCheckUpdateDatabase}
+
+
${uiLabelMap.WebtoolsNote2}
+
+
${uiLabelMap.WebtoolsRemoveAllTables}
+
+
${uiLabelMap.WebtoolsCreateRemoveAllPrimaryKeys}
+
+
+
${uiLabelMap.WebtoolsCreateRemoveAllDeclaredIndices}
+
+
+
+
${uiLabelMap.WebtoolsCreateRemoveAllForeignKeys}
+
${uiLabelMap.WebtoolsNote3}
+
+
+
${uiLabelMap.WebtoolsUpdateCharacterSetAndCollate}
+
+
+
+<#if miters?has_content>
+
+ <#list miters as miter>
+ ${miter}
+ #list>
+
+#if>
\ No newline at end of file
Index: framework/webtools/webapp/webtools/entity/entityref_main.jsp
===================================================================
--- framework/webtools/webapp/webtools/entity/entityref_main.jsp (revision 474917)
+++ framework/webtools/webapp/webtools/entity/entityref_main.jsp (working copy)
@@ -1,202 +0,0 @@
-<%--
-Copyright 2001-2006 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations
-under the License.
---%>
-
-<%@ page import="java.util.*" %>
-<%@ page import="org.ofbiz.entity.*, org.ofbiz.entity.model.*, org.ofbiz.base.util.*" %>
-
-
-
-<%String controlPath=(String)request.getAttribute("_CONTROL_PATH_");%>
-
-<%
-if(security.hasPermission("ENTITY_MAINT", session)) {
- boolean forstatic = "true".equals(request.getParameter("forstatic"));
- String search = null;
- //GenericDelegator delegator = GenericHelperFactory.getDefaultHelper();
- ModelReader reader = delegator.getModelReader();
- Map packages = new HashMap();
- TreeSet packageNames = new TreeSet();
- TreeSet tableNames = new TreeSet();
-
- //put the entityNames TreeSets in a HashMap by packageName
- Collection ec = reader.getEntityNames();
- TreeSet entityNames = new TreeSet(ec);
- Iterator ecIter = ec.iterator();
- while(ecIter.hasNext()) {
- String eName = (String)ecIter.next();
- ModelEntity ent = reader.getModelEntity(eName);
-
- //make sure the table name is in the list of all table names, if not null
- if (UtilValidate.isNotEmpty(ent.getPlainTableName())) tableNames.add(ent.getPlainTableName());
-
- TreeSet entities = (TreeSet)packages.get(ent.getPackageName());
- if(entities == null) {
- entities = new TreeSet();
- packages.put(ent.getPackageName(), entities);
- packageNames.add(ent.getPackageName());
- }
- entities.add(eName);
- }
- int numberOfEntities = ec.size();
- int numberShowed = 0;
- search = (String) request.getParameter("search");
-%>
-
-
-
-
Entity Reference
-
-
-
-
-
-
-
-
Entity Reference Chart
- <%=numberOfEntities%> Total Entities
-
-<%
- Iterator piter = packageNames.iterator();
- while (piter.hasNext()) {
- String pName = (String) piter.next();
- TreeSet entities = (TreeSet) packages.get(pName);
-%>
<%=pName%>
<%
- Iterator i = entities.iterator();
- while (i.hasNext()) {
- String entityName = (String)i.next();
- String helperName = delegator.getEntityHelperName(entityName);
- String groupName = delegator.getEntityGroupName(entityName);
- if (search == null || entityName.toLowerCase().indexOf(search.toLowerCase()) != -1) {
- ModelEntity entity = reader.getModelEntity(entityName);
-%>
-
-
-
- |
- ENTITY: <%=entityName%> | TABLE: <%=entity.getPlainTableName()%>
- <%=entity.getTitle()%>
- <%if (!forstatic) {%> ">[view data]<%}%>
- <%if (entity.getDescription() != null && !entity.getDescription().equalsIgnoreCase("NONE") && !entity.getDescription().equalsIgnoreCase("")) {%>
- <%=entity.getDescription()%>
- <%}%>
- |
-
-
-
-<%
- TreeSet ufields = new TreeSet();
- for (int y = 0; y < entity.getFieldsSize(); y++) {
- ModelField field = entity.getField(y);
- ModelFieldType type = delegator.getEntityFieldType(entity, field.getType());
- String javaName = null;
- javaName = field.getIsPk() ? "" + field.getName() + "" : field.getName();
-%>
-
- <%=javaName%> |
- <%=field.getColName()%> |
- <%=field.getType()%> |
- <%if(type != null){%>
- <%=type.getJavaType()%> |
- <%=type.getSqlType()%> |
- <%}else{%>
- NOT FOUND |
- NOT FOUND |
- <%}%>
-
-<%
- }
- if (entity.getRelationsSize() > 0) {
-%>
-
-
|
-
-
-<%
- TreeSet relations = new TreeSet();
- for (int r = 0; r < entity.getRelationsSize(); r++) {
- ModelRelation relation = entity.getRelation(r);
-%>
-
- |
-
- <%if (relation.getFkName().length() > 0) {%> fk-name: <%=relation.getFkName()%> <%}%>
- |
-
- <%=relation.getType()%>:<%if(relation.getType().length()==3){%> <%}%>
- <%for (int km = 0; km < relation.getKeyMapsSize(); km++){ ModelKeyMap keyMap = relation.getKeyMap(km);%>
- <%=km+1%>)
- <%if(keyMap.getFieldName().equals(keyMap.getRelFieldName())){%><%=keyMap.getFieldName()%>
- <%}else{%><%=keyMap.getFieldName()%> : <%=keyMap.getRelFieldName()%><%}%>
- <%}%>
- |
-
-<%
- }
- }
-%>
-
- | |
-
-
-
-<%
- numberShowed++;
- }
- }
- }
-%>
-
-
Displayed: <%= numberShowed %>
-
-
-
-
-<%}else{%>
-
-
-
Entity Editor
-
-
-
-
Entity Editor
-
-ERROR: You do not have permission to use this page (ENTITY_MAINT needed)
-
-
-
-<%}%>
Index: framework/webtools/webapp/webtools/entity/checkdb.jsp
===================================================================
--- framework/webtools/webapp/webtools/entity/checkdb.jsp (revision 474917)
+++ framework/webtools/webapp/webtools/entity/checkdb.jsp (working copy)
@@ -1,229 +0,0 @@
-<%@page contentType="text/html"%>
-<%--
-Copyright 2001-2006 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not
-use this file except in compliance with the License. You may obtain a copy of
-the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-License for the specific language governing permissions and limitations
-under the License.
---%>
-
-<%@ page import="java.util.*" %>
-<%@ page import="org.ofbiz.base.util.*" %>
-<%@ page import="org.ofbiz.entity.*, org.ofbiz.entity.util.*, org.ofbiz.entity.datasource.*" %>
-<%@ page import="org.ofbiz.entity.model.*, org.ofbiz.entity.jdbc.*" %>
-
-
-
-<%String controlPath=(String)request.getAttribute("_CONTROL_PATH_");%>
-
-<%
-if(security.hasPermission("ENTITY_MAINT", session)) {
- boolean addMissing = "true".equals(request.getParameter("addMissing"));
- boolean checkFkIdx = "true".equals(request.getParameter("checkFkIdx"));
- boolean checkFks = "true".equals(request.getParameter("checkFks"));
- boolean checkPks = "true".equals(request.getParameter("checkPks"));
- boolean repair = "true".equals(request.getParameter("repair"));
- String option = request.getParameter("option");
- String groupName = request.getParameter("groupName");
-
- Iterator miter = null;
- if(groupName != null && groupName.length() > 0) {
- String helperName = delegator.getGroupHelperName(groupName);
-
- List messages = new LinkedList();
- //GenericHelper helper = GenericHelperFactory.getHelper(helperName);
- DatabaseUtil dbUtil = new DatabaseUtil(helperName);
- Map modelEntities = delegator.getModelEntityMapByGroup(groupName);
- Set modelEntityNames = new TreeSet(modelEntities.keySet());
-
- if ("checkupdatetables".equals(option)) {
- List fieldsToRepair = null;
- if (repair) {
- fieldsToRepair = new ArrayList();
- }
- dbUtil.checkDb(modelEntities, fieldsToRepair, messages, checkPks, checkFks, checkFkIdx, addMissing);
- if (fieldsToRepair != null && fieldsToRepair.size() > 0) {
- dbUtil.repairColumnSizeChanges(modelEntities, fieldsToRepair, messages);
- }
- } else if ("removetables".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.deleteTable(modelEntity, messages);
- }
- } else if ("removepks".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.deletePrimaryKey(modelEntity, messages);
- }
- } else if ("createpks".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.createPrimaryKey(modelEntity, messages);
- }
- } else if ("createfkidxs".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.createForeignKeyIndices(modelEntity, messages);
- }
- } else if ("removefkidxs".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.deleteForeignKeyIndices(modelEntity, messages);
- }
- } else if ("createfks".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.createForeignKeys(modelEntity, modelEntities, messages);
- }
- } else if ("removefks".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.deleteForeignKeys(modelEntity, modelEntities, messages);
- }
- } else if ("createidx".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.createDeclaredIndices(modelEntity, messages);
- }
- } else if ("removeidx".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.deleteDeclaredIndices(modelEntity, messages);
- }
- } else if ("updateCharsetCollate".equals(option)) {
- Iterator modelEntityNameIter = modelEntityNames.iterator();
- while (modelEntityNameIter.hasNext()) {
- String modelEntityName = (String) modelEntityNameIter.next();
- ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName);
- dbUtil.updateCharacterSetAndCollation(modelEntity, messages);
- }
- }
- miter = messages.iterator();
- }
-%>
-
-
Check/Update Database
-
-
-
-
NOTE: Use the following at your own risk; make sure you know what you are doing before running these...
-
-
-
-
-
Remove All Tables
-
-
-
Create/Remove All Primary Keys
-
-
-
-
Create/Remove All Declared Indices
-
-
-
-
Create/Remove All Foreign Key Indices
-
-
-
-
Create/Remove All Foreign Keys
-
NOTE: Foreign keys may also be created in the Check/Update database operation if the check-fks-on-start and other options on the datasource element are setup to do so.
-
-
-
-
Update character-set and collate (based on settings on datasource in entityengine.xml)
-
-
-
-
-<%while (miter != null && miter.hasNext()) {%>
- <%String message = (String) miter.next();%>
- - <%=message%>
-<%}%>
-
-<%} else {%>
-
Entity Editor
-
ERROR: You do not have permission to use this page (ENTITY_MAINT needed)
-<%}%>